package com.lzh.hosp.convert.logger;



import java.util.List;
import java.util.Map;
import java.util.stream.Collectors;

import com.lzh.hosp.model.PageResult;
import com.lzh.hosp.model.dataobject.OperateLogDO;
import com.lzh.hosp.model.dto.OperateLogCreateReqDTO;
import org.mapstruct.Mapper;
import org.mapstruct.factory.Mappers;


@Mapper
public interface OperateLogConvert {

//    OperateLogConvert INSTANCE = Mappers.getMapper(OperateLogConvert.class);
//
//    OperateLogDO convert(OperateLogCreateReqDTO bean);
//
//    PageResult<OperateLogRespVO> convertPage(PageResult<OperateLogDO> page);
//
//    OperateLogRespVO convert(OperateLogDO bean);
//
//    default List<OperateLogExcelVO> convertList(List<OperateLogDO> list, Map<Long, AdminUserDO> userMap) {
//        return list.stream().map(operateLog -> {
//            OperateLogExcelVO excelVO = convert02(operateLog);
//            MapUtils.findAndThen(userMap, operateLog.getUserId(), user -> excelVO.setUserNickname(user.getNickname()));
//            excelVO.setSuccessStr(SUCCESS.getCode().equals(operateLog.getResultCode()) ? "成功" : "失败");
//            return excelVO;
//        }).collect(Collectors.toList());
//    }
//
//    OperateLogExcelVO convert02(OperateLogDO bean);

}